﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;

namespace TEL.TelPhoneF
{
    public class Paths
    {
        //private Size sizeWidthMain = new Size(228, 0);
        //private Size sizeHeightMain = new Size(0, 488);
      

        public GraphicsPath GetMainPath(Point Location, Size size)
        {
            GraphicsPath path = new GraphicsPath();


            Rectangle coneRectangleLT = new Rectangle(-1, -1, 100, 100);
            path.AddArc(coneRectangleLT, 180, 90);

            Rectangle coneRectangleRT = new Rectangle(128, -1, 100, 100);
            path.AddArc(coneRectangleRT, 270, 90);

            Rectangle coneRectangleRB = new Rectangle(128, 390, 100, 100);
            path.AddArc(coneRectangleRB, 0, 90);

            Rectangle coneRectangleLB = new Rectangle(-1, 390, 100, 100);
            path.AddArc(coneRectangleLB, 90, 90);

            return path;
        }

        public GraphicsPath GetHistoryPath(Point Location, Size size)
        {
            GraphicsPath path = new GraphicsPath();


            Rectangle coneRectangleLT = new Rectangle(0, 0, 100, 100);
            path.AddArc(coneRectangleLT, 180, 90);

            path.AddLine(new Point(coneRectangleLT.Width/2,0), new Point(size.Width,0) );
            path.AddLine(new Point(size.Width, 0), Location +size);
            path.AddLine(Location +size, new Point(coneRectangleLT.Width / 2, size.Height));

            Rectangle coneRectangleLB = new Rectangle(0, size.Height-100, 100, 100);
            path.AddArc(coneRectangleLB, 90, 90);

            return path;
        }
        public GraphicsPath FairingPath(Point Location, Size size)
        {
            GraphicsPath path = new GraphicsPath();

            Size sizeH = new Size(0, size.Height);
           
            Rectangle rectangle = new Rectangle(Location, size);

            int RadiusTop = 4;
            Size coneSizeTop = new Size(RadiusTop * 2, RadiusTop * 2);

            Rectangle coneRectangleLT = new Rectangle(new Point(rectangle.Left, rectangle.Top), coneSizeTop);
            path.AddArc(coneRectangleLT, 180, 90);

            Rectangle coneRectangleRT = new Rectangle(new Point(rectangle.Right - RadiusTop * 2, rectangle.Top), coneSizeTop);
            path.AddArc(coneRectangleRT, 270, 90);

            Rectangle coneRectangleRB = new Rectangle(new Point(rectangle.Right - RadiusTop * 2, rectangle.Bottom - RadiusTop * 2), coneSizeTop);
            path.AddArc(coneRectangleRB, 0, 90);

            Rectangle coneRectangleLB = new Rectangle(new Point(rectangle.Left, rectangle.Bottom - RadiusTop * 2), coneSizeTop);
            path.AddArc(coneRectangleLB, 90, 90);
            Size r = new Size(0, RadiusTop);
            path.AddLine(Location + sizeH - r, Location + r);

            return path;
        }

        public GraphicsPath FairingLeftPath(Point Location, Size size)
        {
            GraphicsPath path = new GraphicsPath();

            Rectangle rectangle = new Rectangle(Location, size);

            int RadiusTop = 4;
            Size coneSizeTop = new Size(RadiusTop * 2, RadiusTop * 2);


            path.AddLine(rectangle.Right, rectangle.Bottom, rectangle.Left+ RadiusTop, rectangle.Bottom);
          
            Rectangle coneRectangleLB = new Rectangle(new Point(rectangle.Left, rectangle.Bottom - RadiusTop * 2), coneSizeTop);
            path.AddArc(coneRectangleLB, 90, 90);

            Rectangle coneRectangleLT = new Rectangle(new Point(rectangle.Left, rectangle.Top), coneSizeTop);
            path.AddArc(coneRectangleLT, 180, 90);

            path.AddLine(rectangle.Left + RadiusTop, rectangle.Top, rectangle.Right, rectangle.Top);
            path.AddLine(rectangle.Right, rectangle.Top, rectangle.Right, rectangle.Bottom);
            return path;
        }

        public GraphicsPath FairingRightPath(Point Location, Size size)
        {
            GraphicsPath path = new GraphicsPath();

            Size sizeH = new Size(0, size.Height);

            Rectangle rectangle = new Rectangle(Location, size);

            int RadiusTop = 4;
            Size coneSizeTop = new Size(RadiusTop * 2, RadiusTop * 2);

            path.AddLine(Location, new Point(rectangle.Right - RadiusTop, rectangle.Top));
            
            Rectangle coneRectangleRT = new Rectangle(new Point(rectangle.Right - RadiusTop * 2, rectangle.Top), coneSizeTop);
            path.AddArc(coneRectangleRT, 270, 90);

            Rectangle coneRectangleRB = new Rectangle(new Point(rectangle.Right - RadiusTop * 2, rectangle.Bottom - RadiusTop * 2), coneSizeTop);
            path.AddArc(coneRectangleRB, 0, 90);

            path.AddLine(new Point(rectangle.Right - RadiusTop, rectangle.Bottom), Location + sizeH);
            path.AddLine(Location + sizeH, Location);
            return path;
        }

        public GraphicsPath BtnPanelPath(Point Location, Size size)
        {
            GraphicsPath path = new GraphicsPath();

            Rectangle rectangle = new Rectangle(Location, size);
          
            int Radius = 48;
            Size coneSize = new Size(Radius * 2, Radius * 2);

            path.AddLine(Location, new Point(rectangle.Right, rectangle.Top));
            path.AddLine(new Point(rectangle.Right, rectangle.Top), new Point(rectangle.Right, rectangle.Bottom - Radius));

            Rectangle coneRectangleRB =
                new Rectangle(new Point(rectangle.Right - Radius * 2, rectangle.Bottom - Radius * 2), coneSize);
            path.AddArc( coneRectangleRB, 0, 90);

            path.AddLine(new Point(rectangle.Right - Radius, rectangle.Bottom), new Point(rectangle.Left +Radius, rectangle.Bottom));


            Rectangle coneRectangleLB = new Rectangle(new Point(rectangle.Left, rectangle.Bottom - Radius * 2),coneSize);
            path.AddArc( coneRectangleLB, 90, 90);
            path.AddLine(new Point(rectangle.Left, rectangle.Bottom - Radius),Location );
            return path;
        }

    }
}
